﻿function changeBackground(element, element2,url) {
    document.getElementById(element).style.backgroundImage = "url('" + url + "')";
    fadeBackground(element2, 1);
}

function fadeBackground(element, alpha) {
    document.getElementById(element).style.backgroundColor = "rgba(0, 0, 0, " + alpha + ")";
    if (alpha > 0.5) {
        setTimeout(function () { fadeBackground(element, alpha - 0.01); }, 30);
    }
}